package com.exam.dao;

import java.util.ArrayList;
import java.util.List;

import com.exam.entity.Condition;
import com.exam.entity.Hospital;

public class HospitalDaoPgImpl extends BaseDao implements HospitalDao, PostgreSQL
{

	@Override
	public List<Hospital> listHospital(boolean flag) throws Exception
	{
		List<Hospital> list = new ArrayList<Hospital>();
		String sql = "select * from t_hospital where flag = ?";
		list = esql.list(Hospital.class, sql, flag);
		return list;
	}

	@Override
	public List<Condition> listHospitalDetailById(long hospitalId) throws Exception
	{
		List<Condition> list = new ArrayList<Condition>();
		String sql = "select * from t_condition where hospitalid = ?";
		list = esql.list(Condition.class, sql, hospitalId);
		return list;
	}
}
